var limsMaterialSecondaryLibrary = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            index: true
        }, {
            field: 'matCode',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.MATCODE',
            width: 140
        }, {
            field: 'matName',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.MATNAME',
            width: 140
        }, {
            field: 'ext$.mattypename',
            title: 'T_LIMS_MATERIAL.MATTYPENAME',
            width: 140
        }, {
            field: 'ext$.brand',
            title: 'T_LIMS_MATERIAL.BRAND',
            width: 140
        }, {
            field: 'ext$.cargono',
            title: 'T_LIMS_MATERIAL.CARGONO',
            width: 140
        }, {
            field: 'ext$.specifications',
            title: 'T_LIMS_MATERIAL.SPECIFICATIONS',
            width: 140
        }, {
            field: 'ext$.defaultunitcode',
            title: 'T_LIMS_MATERIAL.DEFAULTUNITCODE',
            width: 140
        }, {
            field: 'ext$.purchaseunitcode',
            title: 'T_LIMS_MATERIAL.PURCHASEUNITCODE',
            width: 140
        }, {
            field: 'ext$.storageunitcode',
            title: 'T_LIMS_MATERIAL.STORAGEUNITCODE',
            width: 140
        }, {
            field: 'matNum',
            title: 'T_LIMS_MATERIAL.MATNUM',
            width: 140
        }, {
            field: 'storageLocation',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.STORAGELOCATION',
            editor: true,
            width: 160
        }, {
            field: 'status',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.STATUS',
            editor: true,
            validators: ['notEmpty', 'strLength[0,20]'],
            type: 'select',
            category: 'sys',
            firstBlank: false,
            param: {
                codeCategoryId: 'materialStatus'
            },
            width: 140
        },/* {
            field: 'groupType',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.GROUPTYPE',
            type: 'select',
            search: true,
            firstBlank: false,
            category: 'sys',
            param: {
                codeCategoryId: 'groupType'
            },
            width: 140
        }*/]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'matName',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.MATNAME',
            validators: ['strLength[0,53]']
        }, {
            field: 'matCode',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.MATCODE',
            validators: ['strLength[0,12]']
        }, {
            field: 'storageLocation',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.STORAGELOCATION',
            validators: ['strLength[0,53]']
        }, {
            field: 'status',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.STATUS',
            validators: ['strLength[0,1]']
        }, {
            field: 'groupType',
            title: 'T_LIMS_MATERIAL_SECONDARY_LIBRARY.GROUPTYPE',
            validators: ['strLength[0,12]']
        },]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/rm/material-secondary-librarys',

    /**
     * 二级库存批次表
     */
    getSecondInventoryListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'ext$.storageno',
            title: 'T_LIMS_STANDARD_INVENTORY.STORAGENO',
            width: 140
        }, {
            field: 'ext$.matexpired',
            title: 'T_LIMS_STANDARD_INVENTORY.EXPIRED',
            type: 'select',
            category: 'sys',
            param: {
                codeCategoryId: 'yesorno'
            },
            styleFormatter: function (row) {
                if (row.ext$.matexpired === '1') {
                    return {color: '#FF2D2D'}
                }
            },
            width: 140
        }, {
            field: 'storageNum',
            title: 'T_LIMS_STANDARD_INVENTORY.STORAGENUM',
            width: 140
        }, {
            field: 'batchNum',
            title: 'T_LIMS_STANDARD_INVENTORY.BATCHNUM',
            width: 140
        }, {
            field: 'ext$.storagebatch',
            title: 'T_LIMS_STANDARD_INVENTORY.STORAGEBATCH',
            width: 140
        }, {
            field: 'warrantyExpiryDate',
            title: 'T_LIMS_STANDARD_INVENTORY.WARRANTYEXPIRYDATE',
            type: 'dateTime',
            width: 150
        }, {
            field: 'usefulTime',
            title: 'T_LIMS_STANDARD_INVENTORY.USEFULTIME',
            type: 'dateTime',
            width: 150
        }, {
            field: 'ext$.productiondate',
            title: 'T_LIMS_STANDARD_INVENTORY.PRODUCTIONDATE',
            type: 'dateTime',
            width: 150
        }, {
            field: 'remark',
            title: 'T_LIMS_MATERIAL_SECONDARY_INVENTORY.REMARK',
            width: 160,
            editor: true
        }]
    },

    getStandardInventoryOutFields: function (preInsert) {
        return [{
            field: 'issueType',
            title: 'T_LIMS_STANDARD_HISTORY.ISSUETYPE',
            preInsert: preInsert,
            type: 'select',
            firstBlank: false,
            validators: ['notEmpty'],
            category: 'sys',
            param: {
                codeCategoryId: 'materialOutType'
            },
        }, {
            field: 'outNum',
            title: 'T_LIMS_STANDARD_INVENTORY.OUTNUM',
            preInsert: true,
            validators: ['notEmpty', 'integer', 'numRange(0,)'],
        }];
    },

    getInventoryFormFields: function () {
        return [{
            field: 'difference',
            title: 'T_LIMS_STANDARD_INVENTORY.DIFFERENCE',
            preInsert: true,
            type: 'select',
            category: 'sys',
            param: {
                codeCategoryId: 'operation'
            },
            firstBlank: false,
            validators: ['notEmpty']
        }, {
            field: 'differenceNum',
            title: 'T_LIMS_STANDARD_INVENTORY.DIFFERENCENUM',
            preInsert: true,
            validators: ['notEmpty', 'integer', 'numRange(0,)']
        }, {
            field: 'remark',
            title: 'T_LIMS_MATERIAL_APPLY.REMARK',
            preInsert: true
        }];
    },

    /**
     * 二级库存记录表
     */
    getSecondHistoryListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'status',
            title: 'T_LIMS_STANDARD_HISTORY.AUDITSTATUS',
            width: 90
        },  {
            field: 'ext$.applycode',
            title: 'T_LIMS_MATERIAL_APPLY.APPLYCODE',
            width: 140
        }, {
            field: 'operation',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.OPERATION',
            width: 140
        }, {
            field: 'issueType',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.ISSUETYPE',
            type: 'select',
            firstBlank: false,
            validators: ['notEmpty'],
            category: 'sys',
            param: {
                codeCategoryId: 'materialOutType'
            },
            width: 140
        }, {
            field: 'quantity',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.QUANTITY',
            width: 60
        }, {
            field: 'createdByName',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.CREATEDBYNAME',
            width: 110
        }, {
            field: 'createdTime',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.CREATEDTIME',
            width: 140
        }, {
            field: 'completeTime',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.COMPLETETIME',
            type: 'dateTime',
            width: 140
        }, {
            field: 'createdByOrgName',
            title: 'T_LIMS_MATERIAL_SECONDARY_HISTORY.CREATEDBYORGNAME',
            width: 250
        }]
    },
})
